{{template "Public/header.html" .}}
<link rel="stylesheet" type="text/css" href="/public/css/zTreeStyle.css">
<script language="javascript" src="/public/js/Setting/role.js"></script>
<script language="javascript" src="/public/js/ztree/jquery.ztree.core-3.5.js"></script>
<script language="javascript" src="/public/js/ztree/jquery.ztree.excheck-3.5.js"></script>

{{.tree}}
<SCRIPT type="text/javascript">
	<!--
	var setting = {
		check: {
			enable: true
		},
		data: {
			simpleData: {
				enable: true
			}
		}
	};
	
	
	$(document).ready(function(){
		$.fn.zTree.init($("#tree"), setting, zNodes);
	});
	//-->
</SCRIPT>
<body>
	<div class="subnav">
		<div class="content-menu ib-a blue line-x">
			<a href='/Role/'><em>{{msg . "role_manage"}}</em></a><span>|</span><a
				href='javascript:;' class="on"><em>{{msg . "role_edit"}}</em></a>
		</div>
	</div>
	<div class="pad_10">
		<div class="common-form">
			{{if .role_info}}
				{{$role_info := .role_info}}
				<form name="myform" action="{{url "Role.edit"}}" method="post" onsubmit="return form_submit()" id="myform">
					<table width="100%" class="table_form contentWrap">
						<tr>
							<td><strong>{{msg . "role_name"}}：</strong></td>
							<td>
								<input type="text" name="rolename"
								value="{{$role_info.Rolename}}" class="input-text" id="rolename"></input>
								<div id="rolenameTip" class=""></div>
							</td>
						</tr>
						<tr>
							<td><strong>{{msg . "role_desc"}}：</strong></td>
							<td>
								<textarea name="desc" rows="2" cols="20"
									id="desc" class="inputtext"
									style="height: 100px; width: 500px;">{{$role_info.Desc}}</textarea>
								<div id="descTip" class=""></div>
							</td>
						</tr>
						<tr>
							<td><strong>{{msg . "role_setting"}}：</strong></td>
							<td>
								<ul id="tree" class="ztree"></ul>
							</td>
						</tr>
						<tr>
							<td><strong>{{msg . "role_status"}}：</strong></td>
							<td>
								<input type="radio" name="status" {{if eq $role_info.Status 1}}checked{{end}} value="1"> {{msg . "role_unlock"}}
								<input type="radio" name="status" {{if eq $role_info.Status 0}}checked{{end}} value="0"> {{msg . "role_locked"}}
							</td>
						</tr>
					</table>

					<div class="bk15"></div>
					<input name="id" type="hidden" value="{{$role_info.Id}}">
					<input type="hidden" id="data" name="data" value="" />
					<input type="hidden" name="csrf_token" value="{{ .csrf_token }}" />
					<input name="dosubmit" type="submit" value="{{msg . "submit"}}" class="button">
				</form>
			{{end}}
		</div>
	</div>
</body>
{{template "Public/footer.html" .}}